<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/12/12
  Time: 10:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>


    <link rel="stylesheet" href="../static/css/bootstrap.css">
    <script src="../static/jquery/jquery-2.2.4.min.js"></script>
    <script src="../static/js/bootstrap.min.js"></script>
    <title>Title</title>
    <style type="text/css">
        .namebox {
            width: 100%;
            white-space: nowrap;
            overflow: hidden; /*超出部分隐藏*/
            text-overflow: ellipsis; /*用...代替超出部分*/
            text-align: center;
        }

        a:focus {
            text-decoration: none
        }
    </style>
</head>
<body>
<c:set var="root" value="${pageContext.request.contextPath}"/>


<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${root}/static/css/bootstrap.min.css">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="${root}/static/jquery/jquery-2.2.4.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="/static/js/bootstrap.min.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        /* var wd = $(".nav-pills").width();*/
        jQuery(window).scroll(function () {
            $("#top_cate").css("z-index", 9999);
        });

        $("#top_cate").affix({
            offset: {
                top: 25,
                bottom: function () {
                    return (this.bottom = $('.bottom').outerHeight(true));
                }

            }
        });
    });
</script>

<div class="container">
    <div class="row">

        <jsp:include page="/common/top.jsp"/>


        <div class="col-md-12 " id="top_cate">
            <nav class="navbar navbar-default navbar-static-top" role="navigation">

                <div class="navbar-header">

                    <button class="navbar-toggle" type="button" data-toggle="collapse"
                            data-target="#bs-example-navbar-collapse-1">
                        <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span
                            class="icon-bar"></span><span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand" href="#">良品服装专卖店</a>
                </div>

                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav" id="nav">
                        <li class="active">
                            <a href="/">网站首页</a>
                        </li>
                        <li>
                            <a href="/goods/getNewGoods">新到商品</a>
                        </li>
                        <li>
                            <a href="/goods/getSalesGoods">热销商品</a>
                        </li>
                        <li class="dropdown">
                            <a class="dropdown-toggle" href="#" data-toggle="dropdown">商品分类<strong
                                    class="caret"></strong></a>
                            <ul class="dropdown-menu" id="dropdown_cate">

                                <a class="list-group-item" href="#">女装</a>
                                <a class="list-group-item" href="#">男装</a>
                                <a class="list-group-item" href="#">鞋子</a>
                                <a class="list-group-item" href="#">电脑</a>
                                <a class="list-group-item" href="#">手机</a>

                            </ul>
                        </li>
                    </ul>

                    <form class="navbar-form navbar-left form-inline " role="search" method="post"
                          action="/goods/searchGoods">
                        <div class="form-group">
                            <input class="form-control " type="text" name="keyword" value=""/>
                        </div>

                        <button class="btn btn-default" type="submit">
                            店内搜索
                        </button>
                    </form>

                    <ul class="nav navbar-nav navbar-right">
                        <li class="">
                            <a href="${root}/addUI" style="color: #2aabd2">添加</a>
                        </li>

                        <li class="dropdown">
                            <a class="dropdown-toggle" href="#" data-toggle="dropdown">排序<strong class="caret"></strong></a>
                            <ul class="dropdown-menu">


                                <li>
                                    <a href="#">按价格从低到高</a>
                                </li>
                                <li>
                                    <a href="#">按价格从高到低</a>
                                </li>
                                <li class="divider">
                                </li>
                                <li>
                                    <a href="#">按销量从高到低</a>
                                </li>
                                <li>
                                    <a href="#">按销量从低到高</a>
                                </li>

                            </ul>
                        </li>
                        <li class="col-md-2"></li>
                    </ul>
                </div>

            </nav>
        </div>
    </div>

</div>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-2 column">

            <script type="text/javascript">
                $(document).ready(function () {
                    var wd = $(".nav-pills").width();
                    jQuery(window).scroll(function () {
                        $("#left_cate").css("width", wd);
                    });

                    $("#left_cate").affix({
                        offset: {
                            top: 125,
                            bottom: function () {
                                return (this.bottom = $('.bottom').outerHeight(true));
                            }

                        }
                    });
                });
            </script>
            <div class="list-group">
                <ul class="nav nav-pills nav-stacked" id="left_cate">
                    <a href="#" class="list-group-item" style="text-align: center">女装</a>
                    <a href="#" class="list-group-item" style="text-align: center">男装</a>
                    <a href="#" class="list-group-item" style="text-align: center">鞋子</a>
                    <a href="#" class="list-group-item" style="text-align: center">电脑</a>
                    <a href="#" class="list-group-item" style="text-align: center">手机</a>
                    <a href="#" class="list-group-item" style="text-align: center">平板</a>

                </ul>
            </div>


        </div>
        <div class="col-md-10 column">
            <div class="row">

                <c:forEach var="p" items="${list}">
                    <div class="col-md-3">
                        <div class="thumbnail">
                            <a href="/findDetail?pid=5&page=" class="">
                                <img alt="300x200" style="width: 100%;height: 200px" src="${p.image}"/>
                            </a>
                            <div class="caption text-center">
                                <p class="namebox">
                                        ${p.pname}
                                </p>
                                <p>
                                    原价<span class="glyphicon glyphicon-yen" aria-hidden="true"></span>${p.marketprice}
                                    <span class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
                                </p>
                                <p>
                                    现售<span class="label label-pill label-info" style="text-align: center"><span
                                        class="glyphicon glyphicon-yen" aria-hidden="true"></span>119.0</span>
                                </p>
                                <p>
                                    <a class="btn btn-primary" href="/WEB-INF/edit.jsp">修改</a>
                                    <a class="btn btn-primary" href="${root}/delete?id=${p.pid}"
                                       onclick="return confirm('确认删除此商品吗？')">删除</a>
                                </p>
                            </div>

                        </div>
                    </div>
                </c:forEach>
            </div>
        </div>
    </div>
</div>


<div class="container">
    <div class="row clearfix">
        <div class="col-md-2 column">
        </div>
        <div class="col-md-3 column" style="text-align: right">
            <ul class="pagination">
                <li style="line-height: 35px">
                    第1页/共17页
                </li>
            </ul>

        </div>
        <div class="col-md-7 column" style="text-align: left">

            <ul class="pagination">


                <li class="disabled">
                    <a href="/findPage?page=1">首页</a>
                </li>

                <li>
                    <a href="/findPage?page=2"
                       aria-label="Next">
                        <span aria-hidden="true">下一页</span>
                    </a>
                </li>

                <li><a href="/findPage?page=17">尾页</a></li>


            </ul>
        </div>
    </div>
</div>


<div class="bottom">
    <nav id="bottomNav">
        <div class="col-md-12">
            <ul class="breadcrumb text-center">
                <li><a href="#">店铺信息</a> <span class="divider"></span></li>
                <li><a href="#">商品目录</a> <span class="divider"></span></li>
                <li class="active"><a href="#">联系我们</a></li>
                <div class="text-primary">&copy;&nbsp;zjitc.2018</div>
            </ul>

        </div>
    </nav>
</div>


</body>

<script>

</script>
</html>
